package com.example.demo.configure;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MayanWebConfigure implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        //1.添加拦截器
        InterceptorRegistration interceptorRegistration=registry.addInterceptor(new LoginValidateInterceptor());
        //2.
        interceptorRegistration.addPathPatterns("/user/center","/user/logout","/user/updateUserInfo");
 
        /*registry.addInterceptor(new MyInterceptor1()).addPathPatterns("/test/test1").order(2);
        registry.addInterceptor(new MyInterceptor2()).addPathPatterns("/test/test1").order(1);*/
    }
}
